/********************************************************************************
Name:  PreferredContactAddress
Copyright © 2012  HFH International
======================================================
======================================================
Purpose:
-------
To make only one active Contact Address as preferred. 
======================================================
======================================================
History 
-------
VERSION  AUTHOR                DATE        DETAIL              
  1.0  - CG DEV TEAM    7/10/2012   INITIAL DEVELOPMENT  
*********************************************************************************/ 
trigger PreferredContactAddress on Contact_Address__c(before insert,before update,before delete) {
    

   ContactAddressTriggerHandler triggerhandler=new ContactAddressTriggerHandler(); 
    
        if((trigger.isInsert && trigger.isBefore)){
          
             triggerhandler.ContactAddressInsert(trigger.new);                    
            }
            if(trigger.isUpdate && trigger.isBefore){
            
                triggerhandler.ContactAddressUpdate(trigger.new,trigger.old);
            }
            if(trigger.isdelete && trigger.isBefore){
                triggerhandler.ContactAddressDelete(trigger.old);
            } 

}